hash

open fun hash(@Nullable values: Array<Any>): Int(source)

Generates a hash code for a sequence of input values. The hash code is generated as if all the input values were placed into an array, and that array were hashed by calling hashCode.

This method is useful for implementing hashCode on objects containing multiple fields. For example, if an object that has three fields, x, y, and z, one could write:

@Override public int hashCode() {
    return ObjectsCompat.hash(x, y, z);
}
Warning: When a single object reference is supplied, the returned value does not equal the hash code of that object reference. This value can be computed by calling hashCode.

Return

a hash value of the sequence of input values

Parameters

values

the values to be hashed

See also